home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 February / Ahoy_Magazine_86-02_1986_Double_L.d64 / alignment check (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  3KB  |  107 lines

  1. 10 s=53280:pokes,6:pokes+1,6
  2. 15 tl$="[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
  3. 20 bl$="[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
  4. 25 t=18:tk=t:open15,8,15,"i"
  5. 30 print"[147][158]        [213]"tl$"[201]"
  6. 35 print" [192][192][192][192][192][192][192][194] 1541 alignment check[158] [194][192][192][192][192][192][192][192]"
  7. 40 print"        [202]"tl$"[203]"
  8. 45 print"           by  greg granville"
  9. 50 print"       [213][192][192]actual head position[192][192][192][201]"
  10. 55 print"       [194]      track ="spc(12)"[158][194]"
  11. 60 print"       [202]"bl$"[203]"
  12. 65 print"       [213][192]position read from disk[192][201]"
  13. 70 print"       [194]      track ="spc(12)"[158][194]"
  14. 75 print"       [202]"bl$"[203]"
  15. 80 print"       [213][192][192]error status[192][192][192][192][192][192][192][192][192][192][192][201]"
  16. 85 print"       [194]"spc(25)"[158][194]"
  17. 90 print"       [202]"bl$"[203]"
  18. 95 print"       [213][192][192]alignment status[192][192][192][192][192][192][192][201]"
  19. 100 print"       [194]"spc(25)"[158][194]"
  20. 105 print"       [202]"bl$"[203]"
  21. 110 print"push joystick left & right to move head"
  22. 115 print" hold fire button to read drive status"
  23. 120 :
  24. 125 rem **************************
  25. 130 rem *** calculate t/s read ***
  26. 135 rem **************************
  27. 140 :
  28. 145 print#15,"m-r"chr$(0)chr$(28)
  29. 150 get#15,f$:iff$=""thenf$=chr$(0)
  30. 155 a=asc(f$)
  31. 160 bt=3anda
  32. 165 a=(159anda)or(96+32*((t>17)+(t>24)+(t>30)))
  33. 170 print#15,"m-w"chr$(0)chr$(28)chr$(1)chr$(aor4)
  34. 175 :
  35. 180 rem ******************************
  36. 185 rem *** print status to screen ***
  37. 190 rem ******************************
  38. 195 :
  39. 200 print""tab(21)t"[157]    "
  40. 205 ife<2thenprint""tab(12)"no error detected"
  41. 210 ife>1thenprint""tab(12)"read error sensed"
  42. 215 r$=str$(tk):ife<1thenr$="  "
  43. 220 tr$=right$(r$,2):print""tab(22);tr$
  44. 225 ife<>0and val(tr$)<(t-.5)orval(tr$)>(t+.5)then245
  45. 230 ife>1andt<>int(t)thenprint""tab(14)"alignment ok ":e=0:goto275
  46. 235 ife>1andt=int(t)thenprint""tab(14)"alignment bad":e=0:goto275
  47. 240 goto250
  48. 245 print""tab(14)"alignment bad":e=0:goto275
  49. 250 print""tab(14)" not certain "
  50. 255 rem ***************************
  51. 260 rem ****** read joystick ******
  52. 265 rem ***************************
  53. 270 :
  54. 275 j=notpeek(56320)and15
  55. 280 ifpeek(653)then410
  56. 285 if(notpeek(56320)and16)then410
  57. 290 ifj=4andt>1thenc=-1:goto340
  58. 295 ifj=8andt<35thenc=1:goto340
  59. 300 ifpeek(197)=33thenprint#15,"i":t=18:e=0:a=214:goto160
  60. 305 ifpeek(197)=23then520
  61. 310 goto145
  62. 315 :
  63. 320 rem ****************************
  64. 325 rem *** change head position ***
  65. 330 rem ****************************
  66. 335 :
  67. 340 bt=(bt+c)and3
  68. 345 t=t+c*.5:ift<1thent=1
  69. 350 tk=int(t)
  70. 355 ift>35thent=35
  71. 360 b=a and252
  72. 365 c=b+bt
  73. 370 print#15,"m-w"chr$(0)chr$(28)chr$(1)chr$(c)
  74. 375 e=0
  75. 380 goto145
  76. 385 :
  77. 390 rem ***********************
  78. 395 rem *** read the header ***
  79. 400 rem ***********************
  80. 405 :
  81. 410 m$="":restore
  82. 415 fory=1to11:readx:m$=m$+chr$(x):next
  83. 420 print#15,"m-w"chr$(0)chr$(3)chr$(11)m$
  84. 425 print#15,"m-w"chr$(0)chr$(0)chr$(1)chr$(208)
  85. 430 print#15,"m-r"chr$(0)chr$(0)
  86. 435 get#15,er$:e=asc(er$+chr$(0))
  87. 440 ife>127then340
  88. 445 ife<>1then145
  89. 450 :
  90. 455 rem ****************************
  91. 460 rem *** no error/get track # ***
  92. 465 rem ****************************
  93. 470 :
  94. 475 print#15,"m-r"chr$(22)chr$(0)chr$(4)
  95. 480 forz=1to2:get#15,b$:next
  96. 485 get#15,b$:tk=asc(b$+chr$(0))
  97. 490 goto145
  98. 495 :
  99. 500 rem ****************************
  100. 505 rem *** exit/drive motor off ***
  101. 510 rem ****************************
  102. 515 :
  103. 520 print#15,"m-w"chr$(0)chr$(28)chr$(1)chr$(0)
  104. 525 forx=1to10:getx$:next
  105. 530 close15:print"[147]motor off"chr$(13)"program terminated":end
  106. 535 data169,48,133,69,169,0,133,63,76,177,243
  107.